package com.example.boot.modules.system.dto;

import com.example.starter.webmvc.valid.CreateValid;
import com.example.starter.webmvc.valid.UpdateValid;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author 王令
 * @since 2022-10-28
 */
@Data
@Accessors(chain = true)
public class DictDto {

    @NotNull(message = "id不能为空", groups = {UpdateValid.class})
    private Long id;

    /**
     * 字典名
     */
    @NotEmpty(message = "字典名不能为空", groups = {CreateValid.class, UpdateValid.class})
    @Size(max = 32, message = "字典名长度不能超过32", groups = {CreateValid.class, UpdateValid.class})
    private String name;

    /**
     * 字典编码
     */
    @NotEmpty(message = "字典编码不能为空", groups = {CreateValid.class, UpdateValid.class})
    @Size(max = 32, message = "字典编码长度不能超过32", groups = {CreateValid.class, UpdateValid.class})
    private String code;

}
